#include <stdio.h>
#include <signal.h>
#include <setjmp.h>

jmp_buf buf;

void handler(int s)
{
    if(s == SIGINT) printf("now got a SIGINT signal\n");
    longjmp(buf, 1);
}
int main(void)
{
    signal(SIGINT, handler);
    if(setjmp(buf)) {
        printf("back in main\n");
        return 0;
    } else printf("first time through\n");
    loop:goto loop;
    return 0;
}